/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 artifact_prop_damage.h

	$Header: /heroes4/artifact_prop_damage.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ARTIFACT_PROP_DAMAGE_H_INCLUDED )
#define ARTIFACT_PROP_DAMAGE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "artifact_prop_attack.h"
#include "artifact_prop_effect.h"

namespace t_artifact_prop
{
	// ----------------------------------------------------------------------
	// class for damage bonus
	// ----------------------------------------------------------------------
	class t_damage_bonus_base : public t_artifact_effect, public t_attack
	{
	public:
		void init( int bonus, int additional_bonus, int levels_per_bonus,
				   bool melee, bool ranged, t_damage_type damage_type = k_damage_normal );

		virtual bool	accept( t_artifact_effect_visitor& visitor );
		int				get_additional_bonus() const;
		t_damage_type	get_damage_type() const;
		int				get_levels_per_bonus() const;
		virtual bool	read( std::streambuf& buffer );
		void			set_additional_bonus( int arg );
		void			set_damage_type( t_damage_type arg );
		void			set_levels_per_bonus( int arg );
		virtual bool	write( std::streambuf& buffer ) const;
	protected:
		int				m_additional_bonus;
		t_damage_type	m_damage_type;
		int				m_levels_per_bonus;
	};

	inline void t_damage_bonus_base::init( int bonus, int additional_bonus,  int levels_per_bonus,
		                                   bool melee, bool ranged, t_damage_type damage_type )
	{
		m_amount = bonus;
		m_additional_bonus = additional_bonus;
		m_levels_per_bonus = levels_per_bonus;
		m_affects_melee = melee;
		m_affects_ranged = ranged;
		m_damage_type = damage_type;
	}

	inline int t_damage_bonus_base::get_additional_bonus() const
	{
		return m_additional_bonus;
	}

	inline int t_damage_bonus_base::get_levels_per_bonus() const
	{
		return m_levels_per_bonus;
	}

	inline t_damage_type t_damage_bonus_base::get_damage_type() const
	{
		return m_damage_type;
	}

	inline void t_damage_bonus_base::set_additional_bonus( int arg )
	{
		m_additional_bonus = arg;
	}

	inline void t_damage_bonus_base::set_damage_type( t_damage_type arg )
	{
		m_damage_type = arg;
	}

	inline void t_damage_bonus_base::set_levels_per_bonus( int arg )
	{
		m_levels_per_bonus = arg;
	}

	typedef t_effect< t_damage_bonus_base, k_artifact_effect_damage_bonus > t_damage_bonus;
};

#endif // ARTIFACT_PROP_DAMAGE_H_INCLUDED